﻿Imports System
Imports System.Text
Imports System.Collections.Generic
Imports Microsoft.VisualStudio.TestTools.UnitTesting
Imports System.Security.Cryptography
Imports System.Xml.Linq
Imports System.Reflection

<TestClass()> Public Class UnitTest1

    Private testContextInstance As TestContext

    '''<summary>
    '''Gets or sets the test context which provides
    '''information about and functionality for the current test run.
    '''</summary>
    Public Property TestContext() As TestContext
        Get
            Return testContextInstance
        End Get
        Set(ByVal value As TestContext)
            testContextInstance = Value
        End Set
    End Property

#Region "Additional test attributes"
    '
    ' You can use the following additional attributes as you write your tests:
    '
    ' Use ClassInitialize to run code before running the first test in the class
    ' <ClassInitialize()> Public Shared Sub MyClassInitialize(ByVal testContext As TestContext)
    ' End Sub
    '
    ' Use ClassCleanup to run code after all tests in a class have run
    ' <ClassCleanup()> Public Shared Sub MyClassCleanup()
    ' End Sub
    '
    ' Use TestInitialize to run code before running each test
    ' <TestInitialize()> Public Sub MyTestInitialize()
    ' End Sub
    '
    ' Use TestCleanup to run code after each test has run
    ' <TestCleanup()> Public Sub MyTestCleanup()
    ' End Sub
    '
#End Region

    <TestMethod()> Public Sub TestMethod1()
        ' TODO: Add test logic here

        'TestContext.WriteLine(LSW.Math.GetRandomNum())

        'Dim str = "lishewen"
        'Dim xalg As HashAlgorithm = New LSW.Security.Adler32Managed
        'Dim bt = xalg.ComputeHash(Encoding.Default.GetBytes(str))
        'Dim str1 = ""
        'For Each b In bt
        '    str1 &= String.Format("{0:X2}", b)
        'Next
        'TestContext.WriteLine(str1)

        Dim attr As New XDocument
        Dim _assembly = Assembly.GetAssembly(attr.GetType())
        Dim AssemblyFile = _assembly.CodeBase
        Dim a As New LSW.Reflection.Reflector
        a.Reflect(AssemblyFile)
        TestContext.WriteLine(a.document.ToString)
    End Sub

End Class
